home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13784 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.ncl.ac.uk!usenet
  2. From: n387992 <Guanefu.Li@ncl.ac.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: ??? to disable Control-Break while containing I/O stream
  5. Date: 27 Mar 1996 00:30:59 GMT
  6. Organization: Newcastle University
  7. Message-ID: <4ja283$cdq@whitbeck.ncl.ac.uk>
  8. Reply-To: n4521661@mailserv.ncl.ac.uk
  9. NNTP-Posting-Host: tarn17.ncl.ac.uk
  10. X-Newsreader: WinVN 0.92.5
  11.  
  12. I am writing a program using Borland C++. And I don't want the Control-C or Control-Break
  13. to terminate the program.
  14. So, I used "setcbrk(...)". It did not work.
  15. Control-C still could terminate the program.
  16.  
  17. But some other my programs did not use "setcbrk(...)", but never
  18. got terminated by Control-C.
  19.  
  20. Borland C++ on-line help said:
  21. Sets control-break setting.
  22. setcbrk uses the DOS system call 0x33 to turn control-break checking on or off.
  23.  
  24. value = 0    Turns checking off (check only during I/O to console, printer, 
  25.                 or communications devices).
  26. value = 1    Turns checking on (check at every system call).
  27. ==============================================
  28.  
  29. I just noticed that in this program, there were some statements like
  30. "cout ...." or "cerr ....", those IO stream stuffs, though these
  31. statements were never to be called during the running.
  32.  
  33. I just wonder whether IO stream enforce the effect of Control-C.
  34.  
  35. Is there any way to disable Control-C absolutly?
  36.  
  37. Thank you.
  38.  
  39. Please also send you answer to:
  40.  
  41. n4521661@mailserv.ncl.ac.uk 
  42.